package com.inno.auth.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author sean
 */
@Getter
public enum FeedbackTypeEnum {
    /**
     * "1" 问题反馈
     *  2 功能反馈
     *  3 体验优化
     */
    PROBLEM_FEEDBACK("1", "问题反馈"),
    FUNCTION_FEEDBACK("2", "功能反馈"),
    EXPERIENCE_OPTIMIZATION("3", "体验优化");

    private final String code;
    private final String desc;

    FeedbackTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static FeedbackTypeEnum getByCode(String code) {
        for (FeedbackTypeEnum feedbackTypeEnum : FeedbackTypeEnum.values()) {
            if (feedbackTypeEnum.getCode().equals(code)) {
                return feedbackTypeEnum;
            }
        }
        return null;
    }
    public static String getDescByCode(String code) {
        for (FeedbackTypeEnum feedbackTypeEnum : FeedbackTypeEnum.values()) {
            if (feedbackTypeEnum.getCode().equals(code)) {
                return feedbackTypeEnum.getDesc();
            }
        }
        return StringUtils.EMPTY;
    }
}
